#ifndef READER_H_
#define READER_H_

#include <iostream>
#include <fstream>
#include <string.h>
#include <stdlib.h>

using namespace std;

const int MAX_FILENAME_LEN = 511;
const int MAX_PATH_LEN = 526;


struct DocItem {
  string title;
  string url;
  string content;
};

ostream& operator<<(ostream& oo, const DocItem& item);
istream& operator>>(istream& i, DocItem& item);


class Reader {

public:
  
  Reader();
  ~Reader();

  int read_next_item(DocItem& item);
  bool load_file(const char* fname);

private:

  ifstream file_;
  bool has_loaded_;
};

#endif
